package com.hx_ai.nlp.simple.utils;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

public class InputStreamLoadUtils {

    public static void inputSteamLoad(String name, Charset charset, List<String> lines) {
        InputStream stockStream_1 = InputStreamLoadUtils.class.getResourceAsStream(name);
        if (!Objects.isNull(stockStream_1)) {
            List<String> lines_1 = new BufferedReader(new InputStreamReader(stockStream_1, charset)).lines().collect(Collectors.toList());
            if (!lines_1.isEmpty()) {
                lines.addAll(lines_1);
            }
        }
    }
}
